{php include wl_template('common/header');}
<style>
	.prstyle{color: orangered;}
</style>
<ul class="nav nav-tabs">
	<li class="active"><a href="{php echo web_url('order/orderFreightTemplate/freightlist')}">模板列表</a></li>
</ul>
<div class="app-content">
	<div class="app-filter">
		<div class="filter-action">
			<a href="{php echo web_url('order/orderFreightTemplate/creatfreight')}" class="btn btn-primary">添加模板</a>
		</div>
	</div>
	<div class="app-table-list">
		<div class="table-responsive">
			<table id="de1" class="table table-hover table-bordered">
				<thead>
				<tr>
					<th class="text-center" style="width:50px;">序号</th>
					<th class="text-center" style="width:100px;">模板名称</th>
					<th class="text-center" style="width:250px;">默认区域邮费</th>
					<th class="text-center" style="width:120px;">最新修改时间</th>
					<th class="text-center" style="width:80px;">操作</th>
				</tr>
				</thead>
				<tbody>
				{loop $list $k $item}
				<tr class="text-center" >
					<td>
						<center>{php echo $k+1}</center>
					</td>
					<!--模板名称-->
					<td>
						{$item['name']}
					</td>
					<!--默认地区邮费-->
					<td>
						下单量在<span class="prstyle">{$item['defaultnum']}</span>件内，运费<span class="prstyle">{$item['defaultmoney']}</span>元，每增加<span class="prstyle">{$item['defaultnumex']}</span>件，加运费<span class="prstyle">{$item['defaultmoneyex']}</span>元
						{if $item['freenumber'] > 0},订单满<span class="prstyle">{$item['freenumber']}</span>件包邮。{/if}
					</td>
					<!--最新修改时间-->
					<td>
						{php echo date('Y-m-d H:i:s',$item['createtime'])}
					</td>
					<!--操作-->
					<td>
						<a href="{php echo web_url('order/orderFreightTemplate/creatfreight',array('id'=>$item['id']))}">编辑</a> -
						<a href="javascript:;" itemid="{$item['id']}" class="shanchu">删除</a>
					</td>
				</tr>
				{/loop}
				</tbody>
			</table>
		</div>
		<div class="app-table-foot clearfix">
			<div class="pull-left">
				
			</div>
			<div class="pull-right">
				{$pager}
			</div>
		</div>
	</div>
</div>
<script>
	$('#de1').delegate('.shanchu','click',function(e){
		e.stopPropagation();
		var id = $(this).attr('itemid');
		util.nailConfirm(this, function(state) {
		if(!state) return;
			$.post("{php echo web_url('order/orderFreightTemplate/deleteExpress')}", { id : id }, function(data){
				if(!data.errno){
				util.tips("删除成功！");
				location.reload();
				};
			}, 'json');
		}, {html: '确认删除?'});
	});
</script>
{php include wl_template('common/footer');}